<form id="app-form" class="layui-form layuimini-form">

    <div class="layui-form-item">
        <label class="layui-form-label">是否开启</label>
        <div class="layui-input-block">
            <input type="checkbox" name="is_sign" lay-skin="switch" lay-text="开启|关闭">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">签到提醒</label>
        <div class="layui-input-block">
            <input type="checkbox" name="is_remind" value="1" lay-filter="is_remind" lay-skin="switch" lay-text="是|否">
        </div>
    </div>
    <div class="layui-form-item remind_time layui-hide">
        <label class="layui-form-label">提醒时间</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" name="remind_time" id="remind_time" placeholder="请选择提醒时间">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">赠送类型</label>
        <div class="layui-input-block">
            <input type="radio" name="type" value="0" title="积分">
            <input type="radio" name="type" value="1" title="余额">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">赠送数量</label>
        <div class="layui-input-block">
            <input type="number" name="type_number" required  lay-verify="required" placeholder="请输入赠送数量" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">签到周期</label>
        <div class="layui-input-block">
            <input type="radio" name="cycle" value="0" title="不限制" checked>
            <input type="radio" name="cycle" value="1" title="周末">
            <input type="radio" name="cycle" value="2" title="月末">
            <input type="radio" name="cycle" value="3" title="年末">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">连续规则</label>
        <div class="layui-input-block">
            <input type="radio" name="is_continuity" lay-filter="is_continuity" value="0" title="不设置" checked>
            <input type="radio" name="is_continuity" lay-filter="is_continuity" value="1" title="设置">
        </div>
    </div>
    <div class="continuity_rule " style="display: none">
        <fieldset class="layui-elem-field">
            <legend>规则:</legend>
            <div class="layui-form-item">
                <label class="layui-form-label">连续签到天数</label>
                <div class="layui-input-block">
                    <input type="number" name="continuity_day[]" placeholder="请输入连续签到天数" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">赠送类型</label>
                <div class="layui-input-block">
                    <input type="radio" name="continuity_type[]" value="0" title="积分">
                    <input type="radio" name="continuity_type[]" value="1" title="余额">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">赠送数量</label>
                <div class="layui-input-block">
                    <input type="number" name="continuity_number[]" placeholder="请输入赠送数量" autocomplete="off" class="layui-input">
                </div>
            </div>
        </fieldset>
        <div class="layui-form-item rule_append">
            <button type="button" class="layui-btn layui-btn-primary add-rule layui-btn-xs"><i class="layui-icon">&#xe624;</i>添加规则</button>

        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">累计规则</label>
        <div class="layui-input-block">
            <input type="radio" name="is_cumulative" lay-filter="is_cumulative" value="0" title="不设置" checked>
            <input type="radio" name="is_cumulative" lay-filter="is_cumulative" value="1" title="设置">
        </div>
    </div>
    <div class="cumulative_rule " style="display: none">
        <fieldset class="layui-elem-field">
            <legend>规则:</legend>
            <div class="layui-form-item">
                <label class="layui-form-label">连续签到天数</label>
                <div class="layui-input-block">
                    <input type="number" name="cumulative_day[]" placeholder="请输入连续签到天数" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">赠送类型</label>
                <div class="layui-input-block">
                    <input type="radio" name="cumulative_type[]" value="0" title="积分">
                    <input type="radio" name="cumulative_type[]" value="1" title="余额">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">赠送数量</label>
                <div class="layui-input-block">
                    <input type="number" name="cumulative_number[]" placeholder="请输入赠送数量" autocomplete="off" class="layui-input">
                </div>
            </div>
        </fieldset>
        <div class="layui-form-item cumulative_append">
            <button type="button" class="layui-btn layui-btn-primary add-cumulative layui-btn-xs"><i class="layui-icon">&#xe624;</i>添加规则</button>

        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">签到规则</label>
        <div class="layui-input-block">
            <textarea name="rule" placeholder="请输入规则内容" id="rule"></textarea>
        </div>
    </div>

    <div class="hr-line"></div>
    <div class="layui-form-item text-center">
        <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="sign.config/save" data-refresh="false">确认</button>
        <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
    </div>

</form>

<script type="text/javascript">
    $(document).ready(function () {
        var ue = UE.getEditor('rule');
    })
</script>